chore: migrate backend from pip to uv#4
Open
randroid88 wants to merge 1 commit into
Open
Conversation
Replace requirements.txt with pyproject.toml + uv.lock for reproducible backend dependency management. A single `uv sync` handles Python 3.11 download, venv creation, and dependency installation. The deepfilternet package declares numpy<2.0 but works fine at runtime with numpy 2.x. Since whisperx requires numpy>=2.1, pyproject.toml uses a [tool.uv] override to resolve the conflict automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requirements.txtwithpyproject.toml+uv.lockfor reproducible backend dependency managementuv synccommand handles Python 3.11 download, venv creation, and dependency installation[tool.uv]overrideWhy uv?
uv is a fast Python package manager from Astral. Key benefits:
cd backend && uv syncreplaces the manual venv + pip install workflowuv.lockpins every transitive dependency (no more "works on my machine")numpy<2.0in its metadata but works fine with numpy 2.x at runtime. whisperx requiresnumpy>=2.1. The[tool.uv] override-dependenciessetting resolves this automatically — previously required manual--forceinstallsFiles changed
backend/pyproject.toml— New: project metadata + dependencies + uv overridebackend/uv.lock— New: locked dependency graph (2377 lines)backend/requirements.txt— Deleted (replaced by pyproject.toml).gitignore— Add.venv/(uv uses.venvby default)package.json— Updatedev:backendscript to useuv runREADME.md— Update install instructionsTest plan
curl -LsSf https://astral.sh/uv/install.sh | shcd backend && uv sync— should create.venv/and install all dependenciesuv run uvicorn main:app --reload --port 8642— backend starts successfullynpm run dev— full dev workflow still works end-to-end